//
//  UserManager.swift
//  DianXia
//
//  Created by you&me on 2017/12/15.
//  Copyright © 2017年 you&me. All rights reserved.
//

import UIKit

class UserManager: NSObject {

    static let shareManager = UserManager()

    var lat: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "lat")
        }
        get {
            return UserDefaults.standard.object(forKey: "lat") as? String
        }
    }

    var lng: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "lng")
        }
        get {
            return UserDefaults.standard.object(forKey: "lng") as? String
        }
    }


    var isLogin: Bool? {
        set(newValue) {
           UserDefaults.standard.set(newValue, forKey: "isLogin")
         }
        get {
            return UserDefaults.standard.object(forKey: "isLogin") as? Bool
        }
    }

    var userId: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "userId")
        }
        get {
            return UserDefaults.standard.object(forKey: "userId") as? String
        }
    }

    var userName: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "userName")
        }
        get {
            return UserDefaults.standard.object(forKey: "userName") as? String
        }
    }

    var userMobile: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "userMobile")
        }
        get {
            return UserDefaults.standard.object(forKey: "userMobile") as? String
        }
    }

    var leaderId: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "leaderId")
        }
        get {
            return UserDefaults.standard.object(forKey: "leaderId") as? String
        }
    }

    var leaderName: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "leaderName")
        }
        get {
            return UserDefaults.standard.object(forKey: "leaderName") as? String
        }
    }
    var leaderMobile: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "leaderMobile")
        }
        get {
            return UserDefaults.standard.object(forKey: "leaderMobile") as? String
        }
    }
    var business: String? {
        set(newValue) {
            UserDefaults.standard.set(newValue, forKey: "business")
        }
        get {
            return UserDefaults.standard.object(forKey: "business") as? String
        }
    }
}
